package com.huilian.iotbox.data.enums;

import lombok.Getter;

/**
 * @author LinYinDong
 * @date 2024/5/31 17:54
 */
@Getter
public enum OrderItemShipmentStatusEnum {
    TO_BE_SHIPPED(0, "待出货"),
    SUCCESS(1, "成功"),
    FAIL(2, "失败"),
    PART_FAIL(3, "部分失败"),
    AGAIN(4, "重新出货中"),
    ;


    private Integer code;
    private String desc;

    OrderItemShipmentStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getOrderItemShipmentStatusDesc(Integer code){
        for (OrderItemShipmentStatusEnum value : OrderItemShipmentStatusEnum.values()) {
            if (value.getCode().equals(code)){
                return value.getDesc();
            }
        }
        return null;
    }
}
